<script type="text/javascript" src="__ROOT__/Public/Js/jquery.js"></script>
<script type="text/javascript" src="__ROOT__/Public/Js/jquery.form.js"></script>
<link rel="stylesheet" type="text/css" href="../Public/css/style.css">

<script type="text/javascript">
function insertHtml(url){
	var ext = getFileExt(url);
	if(ext == 'gif' || ext=='jpg'){
		parent.FCKeditorAPI.GetInstance('{.edit}').InsertHtml('<img alt=\'图片\' src=\''+url+'\' />');
	}else{
		parent.FCKeditorAPI.GetInstance('{.edit}').InsertHtml('文件下载:<a href=\''+url+'\' target=\'_blank\'>单击下载</a>');
	}
}

function ShowAttach(url){
	var ext = getFileExt(url);
	if(ext == 'gif' || ext=='jpg'){
		document.write('<img src=\''+url+'\' width=\'40\' height=\'40\' border=\'0\' />');
	}else{
		document.write('<img src=\'../Public/images/adv.gif\' width=\'12\' height=\'12\' border=\'0\' />');
	}
}
function getFileExt(s){
    var i = s.lastIndexOf(".");
    if(i < 0){
     //alert("文件格式不正确!!");
     return false;
    }
    return s.substring(i+1) ;
}
</script>

<table border="0" cellpadding="0" cellspacing="0" >
  <tr>
    <volist name="list" id="vo">
      <td align="center" width="90">&nbsp;<a href="javascript:void(0);" onClick="insertHtml('{$root}/Public/file/{$vo.savename}');" myTip="{$vo.AttachInfo}">
        <script type="text/javascript">ShowAttach('__ROOT__/Public/file/{$vo.savename}');</script>
        <br />
        {$vo.AttachInfo}</a></td>
    </volist>
  </tr>
</table>
<div style="text-align:right; padding:3px; border-top:#CCCC99 solid 1px; margin-top:10px;"><span style=" padding:3px;"><a href="__APP__/Sysattach/upload/edit/{.edit}">继续上传</a></span>&nbsp;{$page}&nbsp;</div>
